# calculate min x0, y0, z0

# calculate min x0
execute store result score x0 mt_surf_fill run data get entity @e[limit=1,tag=mt_surf_fill_in1] Pos[0]

execute store result score x0_temp mt_surf_fill run data get entity @e[limit=1,tag=mt_surf_fill_in2] Pos[0]
execute if score x0 mt_surf_fill > x0_temp mt_surf_fill run scoreboard players operation x0 mt_surf_fill = x0_temp mt_surf_fill

execute store result score x0_temp mt_surf_fill run data get entity @e[limit=1,tag=mt_surf_fill_in3] Pos[0]
execute if score x0 mt_surf_fill > x0_temp mt_surf_fill run scoreboard players operation x0 mt_surf_fill = x0_temp mt_surf_fill

# calculate min y0
execute store result score y0 mt_surf_fill run data get entity @e[limit=1,tag=mt_surf_fill_in1] Pos[1]

execute store result score y0_temp mt_surf_fill run data get entity @e[limit=1,tag=mt_surf_fill_in2] Pos[1]
execute if score y0 mt_surf_fill > y0_temp mt_surf_fill run scoreboard players operation y0 mt_surf_fill = y0_temp mt_surf_fill

execute store result score y0_temp mt_surf_fill run data get entity @e[limit=1,tag=mt_surf_fill_in3] Pos[1]
execute if score y0 mt_surf_fill > y0_temp mt_surf_fill run scoreboard players operation y0 mt_surf_fill = y0_temp mt_surf_fill

# calculate min z0
execute store result score z0 mt_surf_fill run data get entity @e[limit=1,tag=mt_surf_fill_in1] Pos[2]

execute store result score z0_temp mt_surf_fill run data get entity @e[limit=1,tag=mt_surf_fill_in2] Pos[2]
execute if score z0 mt_surf_fill > z0_temp mt_surf_fill run scoreboard players operation z0 mt_surf_fill = z0_temp mt_surf_fill

execute store result score z0_temp mt_surf_fill run data get entity @e[limit=1,tag=mt_surf_fill_in3] Pos[2]
execute if score z0 mt_surf_fill > z0_temp mt_surf_fill run scoreboard players operation z0 mt_surf_fill = z0_temp mt_surf_fill

scoreboard players remove x0 mt_surf_fill 1
scoreboard players remove y0 mt_surf_fill 1
scoreboard players remove z0 mt_surf_fill 1